package com.firemoss.magicbus.messaging.fillter
{
	import com.firemoss.magicbus.filter.IFilter;
	import com.firemoss.magicbus.filter.IFilterChain;

	[DefaultProperty("filters")]
	public class AbstractFilterChain implements IFilterChain
	{
		public function set filters( value : Object ) : void
		{
			if ( value )
			{
				if ( !( value is Array ) )
				{
					value = [ value ]
				} 
				
				_filters = value
			}
			else
			{
				_filters = []
			}
		}
		public function get filters() : Object
		{
			return _filters
		}
		private var _filters : Object
		
		protected function get filterList() : Array
		{
			return filters as Array
		}
		
		public function AbstractFilterChain( filters : Array = null )
		{
			this.filters = filters
		}
		
		public function execute( ...rest ) : *
		{
			return rest
		}
		
		
	}
}